
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>APP更新</title>
        <meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" name="viewport"/>
        <meta content="yes" name="apple-mobile-web-app-capable"/>
        <meta content="black" name="apple-mobile-web-app-status-bar-style"/>
        <meta content="telephone=no" name="format-detection"/>
        <link href="../../Ryancss/app_upgrade.css" rel="stylesheet" type="text/css"/>
       <style>
	   
	   html,body {
    color: #333;
    margin: 0;
    font-family: "Myriad Set Pro","Helvetica Neue",Helvetica,Arial,Verdana,sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-weight: normal;
}

* {
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
}

a {
    text-decoration: none;
    color: #000;
}

a, label, button, input, select {
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

img {
    border: 0;
}

body {
    background: #fff;
    color: #666;
}

html, body, div, dl, dt, dd, ol, ul, li, h1, h2, h3, h4, h5, h6, p, blockquote, pre, button, fieldset, form, input, legend, textarea, th, td {
    margin: 0;
    padding: 0;
}

a {
    text-decoration: none;
    color: #08acee;
}

button {
    outline: 0;
}

img {
    border: 0;
}

button,input,optgroup,select,textarea {
    margin: 0;
    font: inherit;
    color: inherit;
    outline: none;
}

li {
    list-style: none;
}

a {
    color: #666;
}

.clearfix::after {
    clear: both;
    content: ".";
    display: block;
    height: 0;
    visibility: hidden;
}

.clearfix {
}

.divHeight {
    width: 100%;
    height: 10px;
    background: #f5f5f5;
    position: relative;
    overflow: hidden;
}

.r-line {
    position: relative;
}

.r-line:after {
    content: '';
    position: absolute;
    z-index: 0;
    top: 0;
    right: 0;
    height: 100%;
    border-right: 1px solid #D9D9D9;
    -webkit-transform: scaleX(0.5);
    transform: scaleX(0.5);
    -webkit-transform-origin: 100% 0;
    transform-origin: 100% 0;
}

.b-line {
    position: relative;
}

.b-line:after {
    content: '';
    position: absolute;
    z-index: 2;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    border-bottom: 1px solid #e2e2e2;
    -webkit-transform: scaleY(0.5);
    transform: scaleY(0.5);
    -webkit-transform-origin: 0 100%;
    transform-origin: 0 100%;
}

.aui-flex {
    display: -webkit-box;
    display: -webkit-flex;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    align-items: center;
    padding: 15px;
    position: relative;
}

.aui-flex-box {
    -webkit-box-flex: 1;
    -webkit-flex: 1;
    flex: 1;
    min-width: 0;
    font-size: 14px;
    color: #999;
}

/* 必要布局样式css */
.aui-flexView {
    width: 100%;
    height: 100%;
    margin: 0 auto;
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -webkit-flex-direction: column;
    -ms-flex-direction: column;
    flex-direction: column;
}

.aui-scrollView {
    width: 100%;
    height: 100%;
    -webkit-box-flex: 1;
    -webkit-flex: 1;
    -ms-flex: 1;
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    position: relative;
}

.aui-navBar {
    height: 44px;
    position: relative;
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    z-index: 1002;
    background: -webkit-linear-gradient(left, #875151 , #7d6863, #875554 );
    /* Safari 5.1 - 6.0 */
    background: -o-linear-gradient(right, #875151 , #7d6863, #875554 );
    /* Opera 11.1 - 12.0 */
    background: -moz-linear-gradient(right, #875151 , #7d6863, #875554 );
    /* Firefox 3.6 - 15 */
    background: linear-gradient(to right, #875151 , #7d6863, #875554 );
    /* 标准的语法 */
}

.aui-navBar-item {
    height: 44px;
    min-width: 25%;
    -webkit-box-flex: 0;
    -webkit-flex: 0 0 25%;
    -ms-flex: 0 0 25%;
    flex: 0 0 25%;
    padding: 0 0.9rem;
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    font-size: 0.7rem;
    white-space: nowrap;
    overflow: hidden;
    color: #808080;
    position: relative;
}

.aui-navBar-item:first-child {
    -webkit-box-ordinal-group: 2;
    -webkit-order: 1;
    -ms-flex-order: 1;
    order: 1;
    margin-right: -25%;
    font-size: 0.9rem;
    font-weight: bold;
}

.aui-navBar-item:last-child {
    -webkit-box-ordinal-group: 4;
    -webkit-order: 3;
    -ms-flex-order: 3;
    order: 3;
    -webkit-box-pack: end;
    -webkit-justify-content: flex-end;
    -ms-flex-pack: end;
    justify-content: flex-end;
}

.aui-center {
    -webkit-box-ordinal-group: 3;
    -webkit-order: 2;
    -ms-flex-order: 2;
    order: 2;
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    -ms-flex-pack: center;
    justify-content: center;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    height: 44px;
    width: 50%;
    margin-left: 25%;
}

.aui-center-title {
    text-align: center;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    display: block;
    text-overflow: ellipsis;
    font-size: 0.95rem;
    color: #333;
}

.icon {
    width: 20px;
    height: 20px;
    display: block;
    border: none;
    float: left;
    background-size: 20px;
    background-repeat: no-repeat;
}

.icon-return {
    background-image: url('');
}

.icon-share {
    background-image: url('');
}

.aui-page-heads {
    background: -webkit-linear-gradient(to right,  #f370af , #5515ee);
    /* Safari 5.1 - 6.0 */
    background: -o-linear-gradient(to right,  #f370af , #5515ee);
    /* Opera 11.1 - 12.0 */
    background: -moz-linear-gradient(to right,  #f370af , #5515ee);
    /* Firefox 3.6 - 15 */
    background: linear-gradient(to right, #f370af , #5515ee );
    /* 标准的语法 */
    width: 100%;
    position: relative;
    height: 10rem;
}



.aui-page-user {
    width: 32%;
    margin-right: 1rem;
}

.aui-page-heads .aui-flex {
    position: absolute;
    bottom: -50px;
}

.aui-page-user img {
    width: 100%;
    height: auto;
    display: block;
    border: none;
    border-radius: 5px;
}

.aui-flex-box h1 {
    color: #fff;
    font-size: 1.2rem;
    margin-bottom: 1.6rem;
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.aui-flex-box h2 {
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: normal;
}

.aui-flex-box h2 em {
    font-weight: bold;
    font-style: normal;
    font-size: 1.4rem;
}

.aui-top-mar {
    padding-top: 3rem;
}

.icon-time {
    background-size: 16px;
    width: 16px;
    height: 16px;
    margin-right: 0.3rem;
    background-image: url('');
}

.aui-arrow {
    text-align: right;
    color: #808080;
    padding-right: 13px;
    position: relative;
    margin-left: 15px;
}

.aui-arrow {
    font-size: 0.8rem;
    color: #aeb3b9;
}

.aui-arrow:after {
    content: " ";
    display: inline-block;
    height: 7px;
    width: 7px;
    border-width: 1px 1px 0 0;
    border-color: #b7bbbe;
    border-style: solid;
    -webkit-transform: matrix(0.71, 0.71, -0.71, 0.71, 0, 0);
    transform: matrix(0.71, 0.71, -0.71, 0.71, 0, 0);
    position: relative;
    top: -2px;
    position: absolute;
    top: 50%;
    margin-top: -4px;
    right: 2px;
}

.aui-arrow-img {
    width: 50px;
    height: 50px;
}

.aui-arrow-img img {
    width: 100%;
    height: auto;
    display: block;
    border: none;
}

.icon-add {
    background-size: 16px;
    width: 16px;
    height: 16px;
    margin-right: 0.3rem;
    background-image: url('');
}
.icon-bb {
    background-size: 16px;
    width: 16px;
    height: 16px;
    margin-right: 0.3rem;
    background-image: url('');
}


.icon-xq {
    background-size: 16px;
    width: 16px;
    height: 16px;
    margin-right: 0.3rem;
    background-image: url('');
}


.aui-top-mar .aui-flex {
    padding: 8px 15px;
}

.aui-flex-shows {
    box-shadow: 0 1px 25px #f4f4f4;
    border-radius: 8px;
    padding: 5px 10px;
    margin: 5px 15px 5px 15px;
    border: 1px solid #f0f0f2;
}

.aui-bh-img {
    width: 40px;
}

.aui-bh-img img {
    width: 100%;
    height: auto;
    display: block;
    border: none;
}

.aui-flex-box h4 {
    color: #ff3a55;
    font-weight: normal;
    font-size: 0.9rem;
}

.aui-page-button button {
    background: #fef4f5;
    color: #ff274a;
    border: 1px solid #feccd5;
    border-radius: 50px;
    font-size: 0.85rem;
    padding: 0.3rem 0.6rem;
}

.aui-top-mar.b-line:after {
    width: 92%;
    left: 15px;
    bottom: -10px;
}

.aui-flex-shows.b-line:after {
    width: 100%;
    left: 1px;
    bottom: -25px;
}

.aui-flex-lin.b-line:after {
    width: 92%;
    left: 15px;
    bottom: -5px;
}

.icon-pitch {
    background-image: url('');
    background-size: 16px;
    width: 16px;
    height: 16px;
    margin-right: 0.2rem;
}

.aui-flex-box h5 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.aui-flex-box span {
    overflow: hidden;
}

.aui-flex-box span em {
    font-size: 0.85rem;
    font-style: normal;
    float: left;
    margin-right: 0.5rem;
    color: #323139;
    line-height: 1.2;
}

.aui-bao-img {
    width: 50px;
    height: 50px;
}

.aui-bao-img img {
    width: 100%;
    height: auto;
    display: block;
    border: none;
}

.aui-flex-box h6 {
    font-size: 1rem;
    margin-bottom: 0.6rem;
}

.aui-flex-box p {
    font-size: 0.95rem;
    font-weight: bold;
    line-height: 2.2;
}

.aui-pages-img {
    margin: 1rem 0;
}

.aui-pages-img img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 5px;
}

.aui-notice-list .aui-flex-box h2 {
    color: #403f47;
    font-size: 0.9rem;
    font-weight: bold;
    line-height: 1.2;
    margin-bottom: 0.3rem;
}

.aui-notice-list .aui-flex-box p {
    color: #999;
    font-size: 0.9rem;
    line-height: 1.2;
    font-weight: normal;
    margin-left: 1.1rem;
}

.icon-res {
    background-image: url('');
    background-size: 16px;
    width: 16px;
    height: 16px;
    margin-right: 0.3rem;
}

.icon-children {
    background-size: 16px;
    width: 16px;
    height: 16px;
    margin-right: 0.3rem;
    background-image: url('');
}

.aui-notice-list.b-line:after {
    width: 92%;
    left: 15px;
}

.aui-flex-box a {
    display: block;
    background: #f6f6f6;
    border-radius: 50px;
    margin: 0 10px 14px 0;
    float: left;
    padding: 0.5rem 0.7rem;
    color: #323139;
}

.aui-flex-box-p p {
    color: #717075;
    font-size: 0.8rem;
    font-weight: normal;
    line-height: 1.5;
}

.aui-star-user {
    width: 100px;
    margin-right: 1rem;
}

.aui-star-user img {
    width: 100%;
    height: auto;
    display: block;
    border: none;
    border-radius: 5px;
}

.aui-list-star-box .aui-flex {
    -webkit-box-align: inherit;
    -webkit-align-items: inherit;
    align-items: inherit;
}

.aui-nub-text {
    position: absolute;
    right: 15px;
    top: 5rem;
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 100%;
    background-image: -webkit-gradient(linear,left top,bottom top,from(#f71379),to(#f51343));
    background-image: -webkit-linear-gradient(left,#f71379,#f51343);
    background-image: -moz-linear-gradient(left,#f71379,#f51343);
    background-image: linear-gradient(to bottom,#f71379,#f51343);
    background-color: #f51343;
    box-shadow: 0 0 19px #e4acbd;
    text-align: center;
}

.aui-nub-text h1 {
    color: #fff;
    font-weight: normal;
    font-size: 1.2rem;
    padding-top: 0.1rem;
    font-family: "DIN Condensed";
}

.aui-nub-text p {
    color: #fcb7cc;
    font-size: 0.6rem;
    margin-top: -5px;
}

.aui-list-star-box .aui-flex-box h2 {
    font-size: 1.1rem;
    color: #1c1c1c;
    margin-bottom: 0.8rem;
    line-height: 1.9;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    font-weight: bold;
}

.aui-flex-info {
    font-weight: normal;
    font-size: 0.9rem;
    color: #45444c;
    margin-bottom: 0.8rem;
}

.aui-flex-box .aui-tag-texts {
    border: 1px solid #ff6b02;
    color: #ff6b02;
    border-radius: 3px;
    padding: 0.1rem 0.1rem;
    margin-bottom: 0.5rem;
    display: block;
    width: 52px;
    font-size: 0.75rem;
    text-align: center;
}

.aui-list-star-box .aui-flex-box h3 {
    font-weight: normal;
    color: #fe1d3f;
    font-size: 0.8rem;
    margin: 0.9rem 0 0.6rem 0;
}

.aui-flex-box h3 em {
    font-size: 1.1rem;
    font-weight: bold;
    font-style: normal;
}

.aui-list-star-box .aui-flex-box p {
    color: #a7a6ae;
    font-size: 0.8rem;
    font-weight: normal;
    line-height: initial;
}

.aui-flex-box .aui-tag-blue {
    color: #5c6efe;
    border-color: #5c6efe;
}

.aui-bottom-border {
    border-top: 1px solid #eeeeee;
    background: #f6f6f6;
    border-bottom: 1px solid #eeeeee;
}

.aui-book-button {
    padding: 15px 20px 40px 20px;
}

.aui-book-button button {
    background: -webkit-linear-gradient(#fd7c1c, #fe5400);
    background: -o-linear-gradient(#fd7c1c, #fe5400);
    background: -moz-linear-gradient(#fd7c1c, #fe5400);
    background: linear-gradient(#fd7c1c, #fe5400);
    border-radius: 50px;
    width: 100%;
    border: none;
    color: #fff;
    padding: 0.7rem 0;
    font-weight: bold;
}








/*

.container {
	padding-right: 15px;
	padding-left: 15px;
	margin-right: auto;
	margin-left: auto
}



.col-xs-1,.col-sm-1,.col-md-1,.col-lg-1,.col-xs-2,.col-sm-2,.col-md-2,.col-lg-2,.col-xs-3,.col-sm-3,.col-md-3,.col-lg-3,.col-xs-4,.col-sm-4,.col-md-4,.col-lg-4,.col-xs-5,.col-sm-5,.col-md-5,.col-lg-5,.col-xs-6,.col-sm-6,.col-md-6,.col-lg-6,.col-xs-7,.col-sm-7,.col-md-7,.col-lg-7,.col-xs-8,.col-sm-8,.col-md-8,.col-lg-8,.col-xs-9,.col-sm-9,.col-md-9,.col-lg-9,.col-xs-10,.col-sm-10,.col-md-10,.col-lg-10,.col-xs-11,.col-sm-11,.col-md-11,.col-lg-11,.col-xs-12,.col-sm-12,.col-md-12,.col-lg-12 {
	position: relative;
	min-height: 1px;
	padding-right: 15px;
	padding-left: 15px
}



.progress {
	height: 20px;
	margin-bottom: 20px;
	overflow: hidden;
	background-color: #f5f5f5;
	border-radius: 4px;
	-webkit-box-shadow: inset 0 1px 2px rgba(0,0,0,.1);
	box-shadow: inset 0 1px 2px rgba(0,0,0,.1)
}

.progress-bar {
	float: left;
	width: 0;
	height: 100%;
	font-size: 12px;
	line-height: 20px;
	color: #fff;
	text-align: center;
	background-color: #337ab7;
	-webkit-box-shadow: inset 0 -1px 0 rgba(0,0,0,.15);
	box-shadow: inset 0 -1px 0 rgba(0,0,0,.15);
	-webkit-transition: width .6s ease;
	-o-transition: width .6s ease;
	transition: width .6s ease
}

.progress-bar-info {
	    background: linear-gradient(to right, #f370af , #5515ee );
}












		  .progress{
			  height: 25px;
			  background: #262626;
			  padding: 5px;
			  overflow: visible;
			  border-radius: 20px;
			  border-top: 1px solid #000;
			  border-bottom: 1px solid #7992a8;
			  margin-top: 50px;
		  }
		  .progress .progress-bar{
			  border-radius: 20px;
			  position: relative;
			  animation: animate-positive 2s;
		  }
		  .progress .progress-value{
			  display: block;
			  padding: 3px 7px;
			  font-size: 13px;
			  color: #fff;
			  border-radius: 4px;
			  background: #191919;
			  border: 1px solid #000;
			  position: absolute;
			  top: -40px;
			  right: -10px;
		  }
		  .progress .progress-value:after{
			  content: "";
			  border-top: 10px solid #191919;
			  border-left: 10px solid transparent;
			  border-right: 10px solid transparent;
			  position: absolute;
			  bottom: -6px;
			  left: 26%;
		  }
		  .progress-bar.active{
			  animation: reverse progress-bar-stripes 0.40s linear infinite, animate-positive 2s;
		  }
		  @-webkit-keyframes animate-positive{
			  0% { width: 0; }
		  }
		  @keyframes animate-positive{
			  0% { width: 0; }
		  }
 
*/











	   
	   </style>
    </head>
    <body>

        <section class="aui-flexView">
            <section class="aui-scrollView">
                <div class="aui-page-heads">
                    <div class="aui-flex">
                        <div class="aui-page-user">
                            <img src="">
                        </div>
                        <div class="aui-flex-box">
                            <h1 id="new_version_h1">发现新版本</h1>
                            <h2>为了更好的体验 请及时更新！</h2>
                        </div>
                    </div>
                </div>
                <div class="aui-top-mar">
                    <div class="aui-flex b-line">
                        <div>
                            <i class="icon icon-bb "></i>
                        </div>
                        <div class="aui-flex-box aui-flex-box-p">
                            <p id="vsion">当前版本</p>
                        </div>
                        <div class="aui-arrow-img">
                        </div>
                    </div>

  <!--                  <div class="aui-flex b-line">
                        <div>
                            <i class="icon icon-time"></i>
                        </div>
                        <div class="aui-flex-box  aui-flex-box-p">
							  <p id="time">2015.07.14 00:00</p>
                        </div>
                        <div class="aui-arrow-img">
                        </div>
                    </div>

-->
                    <div class="aui-flex">
                        <div>
                            <i class="icon icon-xq "></i>
                        </div>
                        <div class="aui-flex-box aui-flex-box-p">
                            <p id="updateTip">更新内容</p>
                        </div>
                        <div class="aui-arrow-img">
                        </div>
                    </div>


			</div>

 
                <div class="aui-flex aui-flex-shows">

                    <div class="aui-bh-img">
                        <img src="">
                    </div>
                    <div class="aui-flex-box">
                        <h4 id="new_version">最新版本</h4>
                    </div>
                    <div class="aui-page-button"  tapmode onClick="Update_app()">
                        <button>立即更新</button>
                    </div>
                </div>

            </section>
        </section>
<script type="text/javascript" src="../../script/api.js"></script>
<script type="text/javascript">



 var UIActionProgress, value = 0;

  var source = '';                //下载地址
  var api_url = localStorage.getItem('api_url');
  var app_android_apk_down = localStorage.getItem('app_android_apk_down');     // 后台地址 安卓APK 地址	
  var app_ios_down = localStorage.getItem('app_ios_down');    // 后台地址  苹果IOS更新地址




  apiready = function(){
    var appVersion = api.appVersion;
    var vsion = $api.byId('vsion');
    vsion.innerHTML = '您当前使用版本：'+appVersion;   //apicloud 

    api.parseTapmode();

	//引入UIActionProgress模块
    UIActionProgress = api.require('UIActionProgress');
	
	
	checkUpdate();
	
	
									// 网络状态
								api.addEventListener({
									name:'offline'
								}, function(ret, err){        

									api.toast({
									msg : '网络连接异常',
									duration : 5000,
									location : 'middle' 
									});

									  

								});

								api.addEventListener({
									name:'online'
								}, function(ret, err){        
								
									  api.toast({
									  msg : '已经连接网络',
									  duration : 2000,
									  location : 'middle' 
									  });
										  
	checkUpdate();
										  
								});	

  }




/////////////更新app 方法  Ryan   E   ////////////
 function checkUpdate() {


					
					if(api.systemType == 'ios'){
				
					var app_new_Version = localStorage.getItem('Ios_Updated_version')
					var app_new_Version_content = localStorage.getItem('Ios_Updated_content')
					
					}else{
					
					var app_new_Version = localStorage.getItem('Android_Updated_version')
					var app_new_Version_content = localStorage.getItem('Android_Updated_content')
					
					}


							
					 new_version.innerHTML = '最新版本 v ' + app_new_Version;
					 new_version_h1.innerHTML = '发现新版本 v ' + app_new_Version;
					// time.innerHTML = '发布时间: ' + result.time;
					 updateTip.innerHTML = '更新内容: ' + app_new_Version_content;
					 
					


}


/////////////更新app 方法  Ryan   E   ////////////

/*
/////////////更新app 方法  checkUpdate   E  （在apicloud进行）  ////////////
 function checkUpdate() {
var mam = api.require('mam');
mam.checkUpdate(function(ret, err) {
if (ret) {
  var result = ret.result;
  if (result.update == true && result.closed == false) {
    //  var str = '新版本号:' + result.version + '\n更新内容:' + result.updateTip  //下载地址:' + ';发布时间:' + result.time; + result.source + '; 需要的可以加上去
//     var str = '发布时间:' + result.time + '\n更新内容:\n' + result.updateTip   //下载地址:' + ';发布时间:' + result.time; + result.source + '; 需要的可以加上去


//  localStorage.setItem('source',result.source);   //下载地址 保存本地  APICLOUD 地址
  localStorage.setItem('',result.source);   //下载地址 保存本地  APICLOUD 地址
  

  } else {

      api.toast({
          msg : '已是最新版！',
          duration : 5000,
		 location : 'middle' 
      });
	 

	  
  }
} else {
        api.toast({
          msg : err.msg,
          duration : 5000,
		 location : 'middle' 
      });
}
});
}


/////////////更新app 方法  checkUpdate   E   ////////////
*/





//打开模块
                function Update_app() {
				
	if (api.systemType == "android") {

	                        UIActionProgress.open({
                                maskBg : 'rgba(0,0,0,0.4)',
                                styles : {
                                        h : 130,
                                        bg : '#fff',
                                        title : {
                                                size : 14,
                                                color : '#000',
                                                marginT : 10
                                        },
                                        msg : {
                                                size : 12,
                                                color : '#666',
                                                marginT : 5
                                        },
                                        lable : {
                                                size : 12,
                                                color : '#ff3a55',
                                                marginB : 5
                                        },
                                        progressBar : {
                                                size : 4,
                                                normal : '#ccc',
                                                active : '#ff3a55',
                                                marginB : 35,
                                                margin : 5
                                        }
                                },
                                data : {
                                        title : '正在连接服务器...',
                                        msg : '请稍等',
                                        value : 0
                                }
                        }, function(ret) {
                                if (ret.eventType == 'show') {

												  
									  if (api.systemType == "android") {
										  api.download({
											  url : localStorage.getItem('app_android_apk_down'),  
											  report : true
										  }, function(ret, err) {
											  if (ret && 0 == ret.state) {// 下载进度
											  
										//	  percent.innerHTML = ret.percent+'%';
                                                
                                                setData(ret.percent);			  //修改参数 进度条								  
							

			
												
											  }
											  if (ret && 1 == ret.state) {// 下载完成 

												localStorage.setItem('savePath',ret.savePath);   //下载本地位置 保存本地
											  }
										  });
									  }
	
								
                                        //这里应该是调用api.download去下载一个文件，然后根据api.download中的回调下载进度去修改模块参数；
                                        //由于是示例代码，使用setInterval来模拟下载进度变化。
                                        //循环调用
										/*
                                        var timer = setInterval(function() {
                                                if (value > 100) {
                                                        //停止循环
                                                        clearInterval(timer);
                                                        //重置value
                                                        value = 0;
                                                }
                                                //修改参数
                                                setData(value);
                                                //每次给value+5
                                                value += 5;
                                        }, 500);
										
										
									*/	
										
										
                                }
                        });
						
						
	}else{       //ios
	
			  
	
	     api.openApp({
                   iosUrl: localStorage.getItem('app_ios_down')
           },function(ret,err){ 
           });
		   
	   
	
	
	
	}			

                };
				
				
				
				
                //修改参数
                function setData(value) {
                        if (value == 100) {
                                UIActionProgress.setData({
                                        data : {
                                                title : '下载完成',
                                                msg : '准备安装更新',
                                                value : value
                                        }
                                });
								
								
								
                                setTimeout(function() {
                                        //关闭进度条模块
                                        install_app(); // 安装
										
											setTimeout(function() {
											//关闭进度条模块
												closeUIActionProgress();
											}, 300);
                                }, 1000);
								
								
								
								
								
                        } else {
                                //修改进度条参数
                                UIActionProgress.setData({
                                        data : {
                                                title : '下载中...',
												msg : '请稍等',
                                                value : value
                                        }
                                });
                        }
                };
                //关闭模块
				
				
                function closeUIActionProgress() {
                        UIActionProgress.close();     //关闭模块
					 //  UIActionProgress.hide();  		//隐藏
                };






///////////安装APP
function install_app(){

	api.installApp({
	  appUri : localStorage.getItem('savePath')
	});	

}




</script>
</html>
